<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Requirejs</title>
</head>

<body>
  <input type="button" value="点击" id="btn-click">
  <div id="box">
    box
  </div>
  <div>RequireJS 真的很实用，很方便。</div>
  <script src="https://cdn.bootcss.com/require.js/2.3.5/require.js"></script>
  <script>
    require.config({
      baseUrl: '/',
      paths: {
        jquery: "jquery.min"
      }
    });
    var ele = document.getElementById('btn-click');
    ele.onclick = function () {
      requirejs(['jquery'], function ($) {
        //   console.log($('#box')[0]);
      })
    }
  </script>
</body>

</html>